package com.example.sample.ext;

public class ColorHelper {

    /**
     * Return the red component of a color int. This is the same as saying
     * (color >> 16) & 0xFF
     *
     * @param color string
     * @return string
     */
    // (from = 0, to = 255)
    public static int red(int color) {
        return (color >> 16) & 0xFF;
    }

    /**
     * Return the green component of a color int. This is the same as saying
     * (color >> 8) & 0xFF
     *
     * @param color string
     * @return string
     */
    // (from = 0, to = 255)
    public static int green(int color) {
        return (color >> 8) & 0xFF;
    }

    /**
     * Return the blue component of a color int. This is the same as saying
     * color & 0xFF
     *
     * @param color string
     * @return string
     */
    // (from = 0, to = 255)
    public static int blue(int color) {
        return color & 0xFF;
    }
}
